import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HosuerentalVO, HosuerentalForm, HosuerentalQuery } from '@/api/zichanguanli/hosuerental/types';

/**
 * 查询房产(其他)租户信息列表
 * @param query
 * @returns {*}
 */

export const listHosuerental = (query?: HosuerentalQuery): AxiosPromise<HosuerentalVO[]> => {
  return request({
    url: '/zichanguanli/hosuerental/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询房产(其他)租户信息详细
 * @param id
 */
export const getHosuerental = (id: string | number): AxiosPromise<HosuerentalVO> => {
  return request({
    url: '/zichanguanli/hosuerental/' + id,
    method: 'get'
  });
};

/**
 * 新增房产(其他)租户信息
 * @param data
 */
export const addHosuerental = (data: HosuerentalForm) => {
  return request({
    url: '/zichanguanli/hosuerental',
    method: 'post',
    data: data
  });
};

/**
 * 修改房产(其他)租户信息
 * @param data
 */
export const updateHosuerental = (data: HosuerentalForm) => {
  return request({
    url: '/zichanguanli/hosuerental',
    method: 'put',
    data: data
  });
};

/**
 * 删除房产(其他)租户信息
 * @param id
 */
export const delHosuerental = (id: string | number | Array<string | number>) => {
  return request({
    url: '/zichanguanli/hosuerental/' + id,
    method: 'delete'
  });
};
